package base.day17.innerclass;

public class TestInnerClass6 {
    //匿名内部类调用接口
    public static void main(String[] args) {
        goSwimming(new Swimming(){

            @Override
            public void swim() {
                System.out.println("去游泳");
            }
        });


        //lambda表达式
        goSwimming(()->{
            System.out.println("去游泳");
        });

    }
    public static void goSwimming(Swimming swimming){
        swimming.swim();
    }
}
interface Swimming{
    void swim();
}